package com.yami.shop.consign.platform.controller;

import com.yami.shop.common.bean.PageDTO;
import com.yami.shop.common.bean.PageVO;
import com.yami.shop.common.response.ServerResponseEntity;
import com.yami.shop.consign.common.model.ConsignAuditRecord;
import com.yami.shop.consign.common.service.ConsignAuditRecordService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/admin/consign/audit/record")
@Tag(name = "寄售审核记录")
@AllArgsConstructor
@Slf4j
public class ConsignAuditRecordController {
    
    private final ConsignAuditRecordService consignAuditRecordService;

    @GetMapping("/page")
    @Operation(summary =  "获取审核记录列表", description = "获取审核记录列表")
    public ServerResponseEntity<PageVO<ConsignAuditRecord>> page(@Valid PageDTO pageDTO, @RequestParam Long consignId){
        PageVO<ConsignAuditRecord> page = consignAuditRecordService.getPage(pageDTO, consignId);
        return ServerResponseEntity.success(page);
    }
    
}
